import { FormSchema } from '@/components/Form';
import { BasicColumn } from '@/components/Table';
import { DescItem } from '@/components/Description';
import { DicSortEnum } from '@/enums';

/** 表格数据 */
export const columns: BasicColumn[] = [
  {
    title: '名称',
    dataIndex: 'makerName',
    width: 220,
  },
  {
    title: '简称',
    dataIndex: 'shortName',
    width: 220,
  },
  {
    title: '厂商类型',
    dataIndex: 'manufacturerType',
    width: 220,
  },
  {
    title: '联系地址',
    dataIndex: 'address',
    width: 220,
  },
  {
    title: '联系电话',
    dataIndex: 'phoneNumber',
    width: 220,
  },
  {
    title: '厂商邮件',
    dataIndex: 'email',
    width: 220,
  },
  {
    title: '官网地址',
    dataIndex: 'website',
    width: 220,
  },
  {
    title: '联系人姓名',
    dataIndex: 'contactPerson',
    width: 220,
  },
  {
    title: '联系人职位',
    dataIndex: 'contactPosition',
    width: 220,
  },
  {
    title: '成立时间',
    dataIndex: 'establishmentDate',
    width: 220,
  },
  {
    title: '注册资本',
    dataIndex: 'registeredCapital',
    width: 220,
  },
  {
    title: '备注信息',
    dataIndex: 'remarks',
    width: 220,
  },
];

/** 查询数据 */
export const searchFormSchema: FormSchema[] = [
  {
    label: '名称',
    field: 'makerName',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '联系电话',
    field: 'phoneNumber',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: '成立开始时间',
    field: 'startEstablishmentDate',
    component: 'DatePicker',
    colProps: { span: 6 },
  },
  {
    label: '成立结束时间',
    field: 'endEstablishmentDate',
    component: 'DatePicker',
    colProps: { span: 6 },
  },
];

/** 表单数据 */
export const formSchema: FormSchema[] = [
  {
    label: '主键ID',
    field: 'id',
    component: 'Input',
    show: false,
    colProps: { span: 12 },
  },
  {
    label: '名称',
    field: 'makerName',
    component: 'Input',
    required: true,
    colProps: { span: 12 },
  },
  {
    label: '简称',
    field: 'shortName',
    component: 'Input',
    colProps: { span: 12 },
  },
  {
    label: '厂商类型',
    field: 'manufacturerType',
    component: 'Input',
    colProps: { span: 12 },
  },
  {
    label: '联系地址',
    field: 'address',
    component: 'InputTextArea',
    colProps: { span: 24 },
  },
  {
    label: '所在的国家',
    field: 'country',
    component: 'Input',
    colProps: { span: 12 },
  },
  {
    label: '所在的城市',
    field: 'city',
    component: 'Input',
    colProps: { span: 12 },
  },
  {
    label: '联系电话',
    field: 'phoneNumber',
    component: 'Input',
    colProps: { span: 12 },
  },
  {
    label: '传真号码',
    field: 'faxNumber',
    component: 'Input',
    colProps: { span: 12 },
  },
  {
    label: '厂商邮件',
    field: 'email',
    component: 'Input',
    colProps: { span: 12 },
  },
  {
    label: '官网地址',
    field: 'website',
    component: 'Input',
    colProps: { span: 12 },
  },
  {
    label: '联系人姓名',
    field: 'contactPerson',
    component: 'Input',
    colProps: { span: 12 },
  },
  {
    label: '联系人职位',
    field: 'contactPosition',
    component: 'Input',
    colProps: { span: 12 },
  },
  {
    label: '成立时间',
    field: 'establishmentDate',
    component: 'DatePicker',
    colProps: { span: 12 },
  },
  {
    label: '注册资本',
    field: 'registeredCapital',
    component: 'InputNumber',
    defaultValue: DicSortEnum.ZERO,
    colProps: { span: 12 },
  },
  {
    label: '经营范围',
    field: 'businessScope',
    component: 'InputTextArea',
    colProps: { span: 24 },
  },
  {
    label: '备注信息',
    field: 'remarks',
    component: 'InputTextArea',
    colProps: { span: 24 },
  },
];

/** 详情数据 */
export const detailSchema: DescItem[] = [
  {
    label: '名称',
    field: 'makerName',
    span: 12,
  },
  {
    label: '简称',
    field: 'shortName',
    span: 12,
  },
  {
    label: '厂商类型',
    field: 'manufacturerType',
    span: 12,
  },
  {
    label: '联系地址',
    field: 'address',
    span: 12,
  },
  {
    label: '所在的国家',
    field: 'country',
    span: 12,
  },
  {
    label: '所在的城市',
    field: 'city',
    span: 12,
  },
  {
    label: '联系电话',
    field: 'phoneNumber',
    span: 12,
  },
  {
    label: '传真号码',
    field: 'faxNumber',
    span: 12,
  },
  {
    label: '厂商邮件',
    field: 'email',
    span: 12,
  },
  {
    label: '官网地址',
    field: 'website',
    span: 12,
  },
  {
    label: '联系人姓名',
    field: 'contactPerson',
    span: 12,
  },
  {
    label: '联系人职位',
    field: 'contactPosition',
    span: 12,
  },
  {
    label: '成立时间',
    field: 'establishmentDate',
    span: 12,
  },
  {
    label: '注册资本',
    field: 'registeredCapital',
    span: 12,
  },
  {
    label: '经营范围',
    field: 'businessScope',
    span: 12,
  },
  {
    label: '备注信息',
    field: 'remarks',
    span: 12,
  },
];
